A nonvolatile memory refers to a semiconductor device and can continually store the stored data therein when its applied power is off. The nonvolatile memories can be classified as Mask Read-Only Memory (Mask ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and Electrically Erasable Programmable Read-Only Memory (EEPROM). Flash Memory can be considered as one type of the Electrically Erasable Programmable Read-Only Memory.
A nonvolatile memory controller can refer to a reference voltage, such as a bandgap reference voltage, and produces a level of a control signal in a word line for performing an operation of programming, erasing, verifying, or reading for a nonvolatile memory. The bandgap reference voltage the magnitude of which, for example, is around 1.25 volts is a reference voltage independent of temperature.
As the bandgap reference voltage can produce a variance due to either a process deviation or different dies, it is needed to correct at a wafer sort stage. One of correction methods is the one selecting a proper correction code by a reference register for making the bandgap reference voltage correct.
As programming, erasing, verifying, or reading a datum in a nonvolatile memory is based on the bandgap reference voltage, an operating voltage of a word line corresponding to a sensed memory cell during a reading operation is set at the center of a state interval between a programming state and an erasing state, so that a reliable reading operation can be accomplished.
A scheme in the prior art for reading a nonvolatile memory at a power-on stage is disclosed in the US Publication No. 2007/0081377 A1. A fuse memory is partitioned into three memory sections, wherein the second memory section stores configuration information. Three data are read from the three memory sections in the given order and compared with three corresponding backup data for performing verifications respectively.
However, as the configuration information is stored in the fuse memory and the correctness of reading is verified at the power-on stage, it is required to additionally add the fuse memory and a control circuit. Therefore, the volume and the complexity are made to increase.
Please refer to FIG. 1, which is a schematic diagram showing a conventional variation between a source voltage and a time for a nonvolatile memory at a power-on stage. As shown, a voltage range from a state, just applying the source voltage to the nonvolatile memory, to a state, the source voltage reaching a power-on reset finished voltage, corresponds to a power-on reset stage. After the power-on reset stage completes, the source voltage is still rising and may have a phenomenon of an unstable variation in the rising process.
In order to speed up that the configuration information programmed in the nonvolatile memory is loaded into an information register, after the source voltage begins to exceed the power-on reset finished voltage, the configuration information is read from the nonvolatile memory immediately and is verified for writing that into the information register. As the rise phenomenon and the disturbance on the source voltage, a potential risk of errors can exist in reading the configuration information.
Please refer to FIG. 2, which is a schematic block diagram showing a conventional reading operation in a nonvolatile memory system. In FIG. 2, the nonvolatile memory system 30 includes a nonvolatile memory 31, a reference voltage generator 32, and a memory controller 33. Data 311, such as configuration information, are stored in the nonvolatile memory 31.
The reference voltage generator 32 includes a reference register 321 storing a correction code 3211 preset as a default value and produces a reference voltage VREF provided to the memory controller 33. A common reference voltage generator 32 is a bandgap reference voltage generator generating a reference voltage known as a bandgap reference voltage.
The memory controller 33 receives the reference voltage VREF and reads the data 311 in the nonvolatile memory 31 by the reference voltage VREF for obtaining reading results 331.
Please refer to FIG. 3, which is a schematic flow diagram showing a conventional procedure for reading data in a nonvolatile memory at a power-on stage. The read data are, for example, configuration information stored in a flash memory array. A default value is pre-stored in a reference register of a reference voltage generator. In step 402, when a power is turned on, a source voltage applied to the nonvolatile memory begins to rise from zero and a power-on reset stage starts. When the source voltage begins to exceed a power-on reset finished voltage, the power-on reset stage completes and a memory reading of the power-on stage starts.
In step 404, the reference voltage generator produces a reference voltage provided to a memory controller according to the default value. During the reading process, the data in the nonvolatile memory are read in address order. Here, a current address number ADDR being variable is established. It is needed to read the data in total Q addresses, and the data are read from Address 0 (ADDR=0) in order. It is necessary to verify the correctness for the read data. One of verification methods is described as follows. The data in the Q addresses are stored to other Q corresponding addresses as backup data in the nonvolatile memory in advance and corresponding bit levels between the data and the backup data are set inversely. Besides, a success number PCNT being variable representing current times of successful reading is established and is preset as 0.
In step 406, the memory controller reads a first datum, corresponding to a current address of the Q addresses, of the data in the nonvolatile memory by the reference voltage and obtains a first reading result. Afterward, the memory controller similarly reads a first backup datum, corresponding to the first datum, of the backup data at another address in the nonvolatile memory by the reference voltage and obtains a second reading result.
In step 408, the first reading result is compared with the second reading result. An obtained verification result is true when the first reading result and the second reading result are complementary, but is false when the first reading result and the second reading result are not complementary. When the verification result is true, the flow proceeds to step 410. When the verification result is false, the flow goes back to step 406.
In step 410, the success number PCNT is added by 1 for becoming a new success number and the new success number is restored as the success number PCNT.
In step 412, whether the success number PCNT reaches a predetermined number P representing desired times of successful reading for each datum of the data is checked. When the success number PCNT is equal to P, reaching the predetermined number P is true and the flow proceeds to step 414. When the success number PCNT is less than P, reaching the predetermined number P is false and the flow goes back to step 406.
In step 414, the correct reading result of the data with the verification result true is written into an information register, wherein one of devices referring to the information register is a static random access memory.
In step 416, whether the next address exceeds the wanted reading addresses is checked. When the current address number ADDR is equal to Q, exceeding the wanted reading addresses is true and the flow proceeds to step 420. When the current address number ADDR is less than Q, exceeding the wanted reading addresses is false and the flow proceeds to step 418.
In step 418, the current address number ADDR is added by 1 for becoming a new current address number and the new current address number is restored as the current address number ADDR. Moreover, the success number PCNT is reset as 0 and the flow goes back to step 406.
In step 420, the registered data in the information register are sent to a peripheral device requiring the data.
In the aforementioned reading flow, in order to guarantee the read data correct, an error bit check stage including step 406, step 408, step 410 and step 412 is prepared for ensuring the read data reliable.
However, as the default value in the reference register is not the final correction code, the uncorrected bandgap reference voltage can deviate from the objective value (such as 1.25) too much. Therefore, when the source voltage reaches the final stable level, the error bit check stage may not yet end.
Thus, it is necessary to provide a method for exactly reading configuration information in a nonvolatile memory at a power-on stage.